package com.alinu.workbench.service.impl;

import com.alinu.utils.SqlSessionUtil;
import com.alinu.workbench.domain.Customer;
import com.alinu.workbench.mapper.CustomerMapper;
import com.alinu.workbench.service.CustomerService;

import java.util.List;

/**
 * @author chenzuwei
 * @date 2021/3/21
 * @description
 */
public class CustomerServiceImpl implements CustomerService {
    private final CustomerMapper customerMapper = SqlSessionUtil.getSqlSession().getMapper(CustomerMapper.class);

    @Override
    public List<String> getCustomerName(String name) {

        return customerMapper.getCustomerName(name);
    }

    @Override
    public String getCustomerId(String customerName) {
        return customerMapper.findCustomerIdByName(customerName);
    }

    @Override
    public void saveCustomer(Customer customer) {
        customerMapper.saveCustomer(customer);
    }
}
